import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:largefriends/res/lf_double_ext.dart';
import 'package:shimmer/shimmer.dart';

import '../../res/lf_color.dart';

class LfContactListLoading extends StatelessWidget {
  const LfContactListLoading({super.key});

  @override
  Widget build(BuildContext context) {
    return Padding(
        padding: EdgeInsets.symmetric(horizontal: 10.w, vertical: 20.h),
        child: Shimmer.fromColors(
          baseColor: color8F8F8F,
          period: const Duration(seconds: 1),
          highlightColor: color514F62.withAlpha(10),
          child: ListView.separated(
            itemBuilder: (context, index) {
              return _userItem();
            },
            separatorBuilder: (context, index) {
              return 20.h.sbh;
            },
            itemCount: 4,
            physics: const NeverScrollableScrollPhysics(),
          ),
        ));
  }

  Widget _userItem() {
    return Container(
      width: ScreenUtil().screenWidth,
      height: ScreenUtil().screenWidth,
      decoration: BoxDecoration(color: Colors.grey, borderRadius: 10.r.radius),
    );
  }
}
